package org.carabiner.infinitest.depgraph;

import java.util.List;
import java.util.regex.Pattern;

import org.carabiner.infinitest.TestCaseVerifier;

public class RegexVerifier implements TestVerifier
{
  private List<Pattern> list;
  private TestVerifier testCaseVerifier;
  
  public RegexVerifier(List<Pattern> patternList)
  {    
    list = patternList;
    testCaseVerifier = new TestCaseVerifier();
  }

  public boolean isATest(Class clazz)
  {
    if (!testCaseVerifier.isATest(clazz))
      return false;
    for (Pattern pattern : list)
    {
      if (pattern.matcher(clazz.getName()).find())
        return false;
    }
    return true;
  }
}
